package cn.saas.test.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import cn.saas.test.HoleBean;
import cn.saas.test.TowerBean;

import cn.saas.test.greendao.gen.HoleBeanDao;
import cn.saas.test.greendao.gen.TowerBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig holeBeanDaoConfig;
    private final DaoConfig towerBeanDaoConfig;

    private final HoleBeanDao holeBeanDao;
    private final TowerBeanDao towerBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        holeBeanDaoConfig = daoConfigMap.get(HoleBeanDao.class).clone();
        holeBeanDaoConfig.initIdentityScope(type);

        towerBeanDaoConfig = daoConfigMap.get(TowerBeanDao.class).clone();
        towerBeanDaoConfig.initIdentityScope(type);

        holeBeanDao = new HoleBeanDao(holeBeanDaoConfig, this);
        towerBeanDao = new TowerBeanDao(towerBeanDaoConfig, this);

        registerDao(HoleBean.class, holeBeanDao);
        registerDao(TowerBean.class, towerBeanDao);
    }
    
    public void clear() {
        holeBeanDaoConfig.clearIdentityScope();
        towerBeanDaoConfig.clearIdentityScope();
    }

    public HoleBeanDao getHoleBeanDao() {
        return holeBeanDao;
    }

    public TowerBeanDao getTowerBeanDao() {
        return towerBeanDao;
    }

}
